The IDLgrPalette::NearestColor function method returns the index of the palette color that best matches the given RGB values, using a simple squared-distance formula.
Result = Obj->[IDLgrPalette::]NearestColor(Red, Green, Blue)
Returns the index of the color in the palette that best matches the given RGB values. If Red, Green, and Blue are scalars then the result is a long integer. If Red, Green, and Blue are arrays then the result is a byte array.
A scalar or array giving the red values of the colors that should be matched. These values should be within the range of 0 to 255. For arrays the Red, Green, and Blue arguments should have the same number of elements.
A scalar or array giving the green values of the colors that should be matched. These values should be within the range of 0 to 255. For arrays the Red, Green, and Blue arguments should have the same number of elements.
A scalar or array giving the blue values of the colors that should be matched. These values should be within the range of 0 to 255. For arrays the Red, Green, and Blue arguments should have the same number of elements.
None
|
5.0 |
Introduced |
| 8.5 |
Allow arguments to be arrays. |